package com.cap.bts.crmdp.mars.util;

import com.cap.bts.crmdp.dealer.mars.domain.MarsLog;
import com.cap.bts.crmdp.dealer.mars.service.IMarsLogService;
import com.cap.bts.framework.common.util.ApplicationContextUtil;

public class LogTask implements Runnable {
	private MarsLog marsLog;

	public LogTask(MarsLog marsLog) {
		this.marsLog = marsLog;
	}

	@Override
	public void run() {
		IMarsLogService marsLogService = (IMarsLogService) ApplicationContextUtil.getBean("marsLogServiceImpl");
		try{
			marsLogService.insert(marsLog);
		}catch(Exception e){
			try {
				Thread.sleep(30000);
				marsLogService.insert(marsLog);
			} catch (InterruptedException e1) {
				
			}
		}
	}
}